/**
 * @description： 节流函数
 *  函数节流封装
 */
export function throttle (func, wait) {
    let previous = 0
    return function () {
        let now = Date.now()
        let context = this;
        let args = arguments;
        if (now - previous > wait) {
            func.apply(context, args);
            previous = now
        }
    }       
}